package com.wjc.train.business.controller;

import com.wjc.train.business.req.DailyTrainStationQueryAllReq;
import com.wjc.train.business.resp.DailyTrainStationQueryResp;
import com.wjc.train.business.service.IDailyTrainStationService;
import com.wjc.train.common.resp.CommonResp;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 余票信息 前端控制器
 * </p>
 *
 * @author Guessed
 * @since 2023-08-14
 */
@RestController
@Validated
@RequestMapping("/daily-train-station")
public class WebDailyTrainStationController {

    @Resource
    private IDailyTrainStationService dailyTrainStationService;

    @PostMapping("query-by-train-code")
    public CommonResp queryByTrain(@RequestBody  DailyTrainStationQueryAllReq req){
        List<DailyTrainStationQueryResp> list = dailyTrainStationService.queryByTrain(req.getDate(),req.getTrainCode());
        return CommonResp.success(list);
    }


}


